<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">             	
  	
<h:form id="formConsultarMilestone" prependId="false"> 
	<p:commandButton value="Projeto" action="#{projetoBean.viewProjeto}" immediate="true" />
	<p:commandButton value="Atividade" action="#{atividadeBean.consultarAtividade}"/>
 	<p:commandButton value="Milestone" action="#{milestoneBean.consultarMilestone}"/>
 	<p:commandButton value="Membro" action="#{projetoBean.membroProjeto}"/>
 	<p:commandButton value="Log" action="#{projetoBean.consultarLog}"/> 
	<p:panel id="idPanelConsultarMilestone" header="Consultar Milestones do Projeto #{projetoBean.projeto.nomeProjeto}" style=" font-size:20px; margin-bottom:20px; ">  
 	<p:growl id="growl" showDetail="true"/> 
    	<h:panelGrid columns="4" style="text-align:center; margin-top:20px; margin-right:10%;">  
            <h:outputLabel value="Código do Milestone:" style="font-size:14px;"/>  
            <p:inputText  style="width:100px; heigth:15px; font-size:14px;"/>  
  
            <p:outputLabel value="Nome do Milestone:" style="font-size:14px; padding-left:10px;"/>  
            <p:inputText value="#{projetoBean.milestone.descricao}" style="width:200px; heigth:15px; font-size:14px;"/>  

  
        </h:panelGrid>  
    </p:panel>  
    <p:commandButton value="Consultar" actionListener="#{projetoBean.listaMilestone}" update="dataTableMilestone" style="margin-right:20px; margin-left:10px;" /> 
    <p:commandButton value="Novo" action="#{projetoBean.novoMilestone}" style="margin-right:20px;" /> 
	<p:commandButton value="Limpar" style="margin-right:20px;"  />
    		
   		
    <p:dataTable id="dataTableMilestone" var="milestone" value="#{projetoBean.listaMilestone}"  
    			 rowKey="#{milestone.idMilestone}" selectionMode="single" style="padding-top:20px; width:50%">  
        <f:facet name="header">Milestone do Projeto</f:facet>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Milestone" />  
            </f:facet>  
            <h:outputText value="#{milestone.descricao}" />  
        </p:column>  
  
        <p:column style="text-align:center">  
            <f:facet name="header">  
                <h:outputText value="Data" />  
            </f:facet>  
            <h:outputText value="#{milestone.dtFinal}" >
            	<f:convertDateTime dateStyle="medium"/>
            </h:outputText>  
        </p:column>  
        
        <p:column style="width:4%">  
        	<f:facet name="header">
        	 <h:outputText value="Editar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar" action="#{projetoBean.editarMilestone}" icon="ui-icon-search" title="Detail" >
        		<f:setPropertyActionListener value="#{milestone}" target="#{projetoBean.milestoneSelect}" />  
            </p:commandButton>
        </p:column> 
        
        <p:column style="width:4%" rendered="#{projetoBean.renderedGerente()}">  
            <f:facet name="header">
        	 <h:outputText value="Excluir" />
        	</f:facet> 
         	<p:commandButton id="selectButtonDelete" action="#{projetoBean.excluirMilestone}" icon="ui-icon-trash" title="Delete" >
         		<f:setPropertyActionListener value="#{milestone}" target="#{projetoBean.milestoneSelect}" />  
            </p:commandButton>
        </p:column>
    </p:dataTable>   
</h:form>  	



</ui:define>
</ui:composition>
